package com.combetter.changxing.db.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;

import com.combetter.changxing.db.entity.UpLoadFacility;

import java.util.List;

/**
 * 类名  ElectronicPipe
 * 作者  tlfx: Sean.guo
 * 日期  2019/4/9 11:38
 */
@Dao
public interface HistoryDataDao {
    /**
     * 查询所有历史信息
     *
     * @return
     */
    @Query("SELECT * FROM upload_facility_table")
    List<UpLoadFacility> getFacilityInfoList();

    @Query("SELECT * FROM upload_facility_table WHERE _facilityAddress = :mac")
    UpLoadFacility findByMac(String mac);

    /**
     * 添加设备信息
     *
     * @param students
     * @return
     */
    @Insert
    void insertAllOrSingle(UpLoadFacility... students);

    @Query("DELETE FROM upload_facility_table")
    void deleteAll();

}
